package a.i;

import java.util.Comparator;
import java.util.List;
import java.util.ListIterator;

class j
{
  private static final int a = 8;
  private static final Comparator c = new b_(null);
  
  static void a(List paramList, Comparator paramComparator)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    Object[] arrayOfObject = paramList.toArray();
    c(arrayOfObject, 0, arrayOfObject.length, paramComparator);
    ListIterator localListIterator = paramList.listIterator();
    int i = 0;
    int j = arrayOfObject.length;
    do
    {
      while (!bool1)
      {
        if (i >= j) {
          break;
        }
        localListIterator.next();
        localListIterator.set(arrayOfObject[i]);
        i++;
      }
    } while (bool2);
  }
  
  static void a(Object[] paramArrayOfObject, Comparator paramComparator)
  {
    c(paramArrayOfObject, 0, paramArrayOfObject.length, paramComparator);
  }
  
  static void a(Object[] paramArrayOfObject, int paramInt1, int paramInt2, Comparator paramComparator)
  {
    c(paramArrayOfObject, paramInt1, paramInt2, paramComparator);
  }
  
  private static void c(Object[] paramArrayOfObject, int paramInt1, int paramInt2, Comparator paramComparator)
  {
    if (!p.b) {}
    a(paramArrayOfObject, new Object[paramInt2 - paramInt1], paramInt1, paramInt2 - 1, -paramInt1, paramComparator == null ? c : paramComparator);
  }
  
  private static void a(Object[] paramArrayOfObject1, Object[] paramArrayOfObject2, int paramInt1, int paramInt2, int paramInt3, Comparator paramComparator)
  {
    boolean bool2 = p.b;
    boolean bool1 = p.a;
    int j;
    int m;
    if (!bool2) {
      if (paramInt2 - paramInt1 < 8)
      {
        i = paramInt1 + 1;
        j = paramInt2 + 1;
        label97:
        do
        {
          if (i >= j) {
            break;
          }
          Object localObject = paramArrayOfObject1[i];
          m = i;
          do
          {
            do
            {
              if (m <= paramInt1) {
                break label97;
              }
              if (bool1) {
                break;
              }
              if (paramComparator.compare(paramArrayOfObject1[(m - 1)], localObject) <= 0) {
                break label97;
              }
              paramArrayOfObject1[m] = paramArrayOfObject1[(m - 1)];
              m--;
            } while (!bool1);
            paramArrayOfObject1[m] = localObject;
            i++;
          } while (bool2);
        } while (!bool1);
      }
    }
    int i = (paramInt1 + paramInt2) / 2;
    a(paramArrayOfObject1, paramArrayOfObject2, paramInt1, i, paramInt3, paramComparator);
    a(paramArrayOfObject1, paramArrayOfObject2, i + 1, paramInt2, paramInt3, paramComparator);
    if (!bool2) {
      if (!bool2)
      {
        if (paramComparator.compare(paramArrayOfObject1[i], paramArrayOfObject1[(i + 1)]) > 0) {
          System.arraycopy(paramArrayOfObject1, paramInt1, paramArrayOfObject2, paramInt3 + paramInt1, i - paramInt1 + 1);
        }
      }
      else
      {
        j = i;
        do
        {
          do
          {
            if (j >= paramInt2) {
              break;
            }
            paramArrayOfObject2[(paramInt3 + paramInt2 + i - j)] = paramArrayOfObject1[(j + 1)];
            j++;
            if (bool2) {
              break label256;
            }
            if (bool1) {
              break label252;
            }
          } while (!bool1);
        } while (bool2);
        j = paramInt3 + paramInt1;
        label252:
        int k = paramInt3 + paramInt2;
        label256:
        m = paramInt3 + i;
        int n = paramInt1;
        int i1 = paramInt2 + 1;
        label318:
        label327:
        do
        {
          if (n >= i1) {
            break;
          }
          if (!bool2)
          {
            if (j > m) {
              break label318;
            }
            if (bool2) {
              break label327;
            }
          }
          paramArrayOfObject1[n] = (paramComparator.compare(paramArrayOfObject2[j], paramArrayOfObject2[k]) > 0 ? paramArrayOfObject2[(k--)] : paramArrayOfObject2[(j++)]);
          n++;
        } while (!bool1);
      }
    }
  }
  
  private static final class b_
    implements Comparator
  {
    private b_() {}
    
    public int compare(Object paramObject1, Object paramObject2)
    {
      return ((Comparable)paramObject1).compareTo(paramObject2);
    }
    
    b_(j.0 param0)
    {
      this();
    }
  }
}


/* Location:           E:\idea\
 * Qualified Name:     a.i.j
 * JD-Core Version:    0.7.0.1
 */